//
//  ZRWelcomeController.m
//  SinaByOC
//
//  Created by 张锐 on 16/3/18.
//  Copyright © 2016年 zhangr. All rights reserved.
//

#import "ZRWelcomeController.h"
#import "ZRWecomeView.h"

@interface ZRWelcomeController ()

@end

@implementation ZRWelcomeController

-(void)loadView{

    ZRWecomeView *welcomeView = [[ZRWecomeView alloc]init];
    
    self.view = welcomeView;
    
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    NSUserDefaults * ud = [NSUserDefaults standardUserDefaults];
    
     ZRWecomeView * welcomeView = (ZRWecomeView *)self.view;
    
    [welcomeView setIconImage: [ud objectForKey:@"profile_image_url"]andWelcomeText:[ud objectForKey:@"screen_name"]];


}

-(void)viewDidAppear:(BOOL)animated{

    [super viewDidAppear:animated];
    
    ZRWecomeView * welcomeView = (ZRWecomeView *)self.view;
    
    [welcomeView startAnimationWithFinishedBlock:^{
        
        //发送通知更改根控制器
        [[NSNotificationCenter defaultCenter]postNotificationName:@"changeRootViewController" object:nil];
        
    }];

}






@end
